import "package:flutter/material.dart";

class ListDividerGenerator {
  List<Widget> sourceItems;
  List<Widget> _items = [];
  Widget divider;
  ListDividerGenerator(this.sourceItems, this.divider){

    for(var index = 0; index < (sourceItems.length * 2) - 1; index++){
      var canDivider = index % 2 != 0;
      if (canDivider) _items.add(this.divider);
      else {
        var sourceIndex = index ~/ 2;
        _items.add(sourceItems[sourceIndex]);
      }
    }

  }
  List<Widget> get items => _items;

}